CC = gcc

all: factory queue conf zipmap

factory: factory.c factory.o queue.o config.o dict.o
	$(CC) -o $@ $^ -g

queue: queue.c queue.o config.o dict.o
	$(CC) -o $@ $^ -g

conf: conf.c config.o dict.o
	$(CC) -o $@ $^ -g

zipmap: zipmap.c zipmap.o
	$(CC) -o $@ $^ -g

zipmap.o: ../src/zipmap.c
	$(CC) -c $<

factory.o: ../src/factory.c queue.o
	$(CC) -c $<

queue.o: ../src/queue.c config.o
	$(CC) -c $<

config.o: ../src/config.c
	$(CC) -c $<

dict.o: ../src/dict.c
	$(CC) -c $<

clean:
	rm -f *.o
	rm -f zipmap conf queue factory

.PHONY: clean
